<?php

defined('SYSPATH') or die('Access error!');

class Controller_Store extends Controller_Store_Main
{

    public function before()
    {
        parent::before();
        I18n::set_current_file('store');
    }

    public function action_index()
    {
        //获取某个店铺的推荐产品（4件）
        $store_recommend_goods = Model::factory('shop_goods')->get_category_recommend_goods('new','','g.store_id='.$this->store_detail['id'],4);
       //获取所有产品并分页
        $store_goods_list = Model::factory('shop_goods')->get_store_goods($this->store_detail['id']);
        $this->template->assign('goods_list',$store_goods_list['list']);
        $this->template->assign('pagenation',$store_goods_list['page']);
        $this->template->assign('store_recommend_goods',$store_recommend_goods);
        $this->template->assign('data',$this->store_detail);
        $this->template->view('index');
    }

}